import re
pattern = '黑客|破解|反爬'

# 替换
s='我想学习Python，想破解一些VIP视频，Python可以实现无底线反爬吗？'
new_s = re.sub(pattern, 'XXX', s)
print(new_s)

# 分割
s2='https://www.baidu.com/s?wd=ysj&ie=utf-8&tn=baidu'
pattern2 = '[?|&]'
lst = re.split(pattern2, s2)
print(lst)